home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 011 / stuffit.arc / RENFILE.ASM < prev    next >
Encoding:
Assembly Source File  |  1985-11-18  |  768 b   |  43 lines

  1. comment ~
  2.  
  3.         rename a file
  4.  
  5. On entry:
  6.     DX    ASCIIZ string of file to be renamed
  7.     DI    ASCIIZ string of new name
  8.  
  9. Error returns if CY set:
  10.     3    Path not found
  11.     5    Access denied
  12.     17    Not same device
  13.  
  14. ~
  15. ;----------------------------------------------------------
  16. ;        constants and messages
  17.  
  18. rf_msg        db    cr,lf,'renfile: ',eos
  19.  
  20. ;----------------------------------------------------------
  21. ;        main code
  22.  
  23. renfile        proc    near
  24.  
  25.         mov    ah,56h
  26.         int    21h
  27.         jc    rf_err
  28.         ret
  29.  
  30. rf_err:
  31.         push    ax            ;save error code
  32.         mov    dx,offset rf_msg
  33.         mov    ah,9h
  34.         int    21h
  35.         pop    ax
  36.         push    ax            ;save again, to be sure
  37.         call    errmsg
  38.         pop    ax            ;restore, to Q in caller
  39.         stc 
  40.         ret
  41.  
  42. renfile        endp
  43.